﻿<%@ Page Language="C#" MasterPageFile="~/Template/Index_Manager.Master" AutoEventWireup="true" CodeBehind="UpdateTicket.aspx.cs" Inherits="eProjectRailWayReservation.Admin.UpdateTicket1" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="headContent" runat="server">
    <script type="text/javascript" src="../Scripts/admin_script/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="../Scripts/jquery.ui.datepicker.js"></script>  
    <link rel="stylesheet" type="text/css" href="../Scripts/admin_script/jquery-ui-1.8.2.custom.css" />
    
    <script type="text/javascript">
        $(document).ready(function() {
            $("#<%=txtCreateDate.ClientID %>").datepicker({ showOn: 'button', buttonImage: '../Images/calendar.png', buttonImageOnly: true });

            var chkBox = $("input[id$=ChkAll]");
            chkBox.click(function() {
                $("#<%=gvTicket.ClientID %> INPUT[type='checkbox']").attr('checked', chkBox.is(':checked'));
            });

            // To deselect CheckAll when a GridView CheckBox
            // is unchecked
            $("#<%=gvTicket.ClientID %> INPUT[type='checkbox']").click(function(e) {
                if (!$(this)[0].checked) {
                    chkBox.attr("checked", false);
                }
            });
        });
    </script>
    
    <script type="text/javascript" language="javascript">
    function DeleteConfirmation()
    {
    if (confirm("Are you sure," 
            "you want to delete selected records ?")==true)
            return true;
            else
            return false;
    }
</script>
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"></asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <div style="background: none repeat scroll 0% 0% rgb(231, 239, 239); border: 1px solid rgb(198, 215, 215); padding: 3px; margin-bottom: 15px;">
        <table cellspacing="0" cellpadding="6">
            <tbody>
                <tr>
                    <td> Customer Name :<br /><asp:TextBox ID="txtCustomerName" runat="server" style="margin-top: 4px;" Width="125px"></asp:TextBox></td>
                    <td> Create Date:<br /><asp:TextBox ID="txtCreateDate" runat="server" style="margin-top: 4px;" Width="125px"></asp:TextBox>
                                            </td>
                    <td> Status:<br /><asp:DropDownList runat="server" ID="ddlStatus" 
                            style="width:100px;margin-top: 4px;" AutoPostBack="True" 
                            onselectedindexchanged="ddlStatus_SelectedIndexChanged">
              		    <asp:ListItem Value="0">Pending</asp:ListItem>
              		    <asp:ListItem Value="1">Complete</asp:ListItem>
              		    <asp:ListItem Value="2">Canceled</asp:ListItem>
              		    </asp:DropDownList>&nbsp;
                        <asp:LinkButton ID="lblSearch" runat="server" onclick="lblSearch_Click1"><span>Search</span></asp:LinkButton>
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:LinkButton ID="lblPay" runat="server" onclick="lblCancel_Click" 
                            OnClientClick="return DeleteConfirmation();"><span>Cancel</span></asp:LinkButton>
                         &nbsp;&nbsp;&nbsp;
                        <asp:LinkButton ID="lblDelete" runat="server" onclick="lblPay_Click"><span>Pay</span></asp:LinkButton>
                         &nbsp;</td>
                        <td align="right">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</td>
                        </tr>
            </tbody>
        </table>
    </div>
    <asp:GridView ID="gvTicket" runat="server" CssClass="list" 
        AutoGenerateColumns="False" Height="119px" Width="740px" 
        AllowPaging="True" onpageindexchanging="gvTicket_PageIndexChanging" >
        <Columns>
            <asp:TemplateField HeaderStyle-Width="1px">
                <HeaderTemplate>
                    <asp:CheckBox ID="ChkAll" runat="server"/>
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:CheckBox ID="cbSelectAll" runat="server" />
                </ItemTemplate>
                <HeaderStyle Width="1px"></HeaderStyle>
            </asp:TemplateField>
            <asp:BoundField DataField="TicketID" HeaderText="Ticket No" HeaderStyle-CssClass="left">
                <HeaderStyle CssClass="left"></HeaderStyle>
            </asp:BoundField>
            <asp:BoundField HeaderText="PaName" DataField="PaName"></asp:BoundField>
            <asp:BoundField DataField="FromStation" HeaderText="From" 
                SortExpression="FromStation" />
            <asp:BoundField DataField="ToStation" HeaderText="To" 
                SortExpression="ToStation" />
            <asp:BoundField HeaderText="Train ID" HeaderStyle-CssClass="left" 
                DataField="TrainID">
<HeaderStyle CssClass="left"></HeaderStyle>
            </asp:BoundField>
            <asp:BoundField DataField="Date" HeaderText="Date" HeaderStyle-CssClass="left">
<HeaderStyle CssClass="left"></HeaderStyle>
            </asp:BoundField>
            <asp:BoundField DataField="SeatNo" HeaderText="SeatNo">
                <ItemStyle CssClass="right"></ItemStyle>
            </asp:BoundField>
            <asp:BoundField HeaderText="Fare" HeaderStyle-CssClass="right" 
                ItemStyle-CssClass="right" DataField="Fare">
<HeaderStyle CssClass="right"></HeaderStyle>

                <ItemStyle CssClass="right"></ItemStyle>
            </asp:BoundField>
            <asp:BoundField DataField="TicketStatus" HeaderText="Status" 
                HeaderStyle-CssClass="left">
<HeaderStyle CssClass="left"></HeaderStyle>
            </asp:BoundField>
            <asp:TemplateField ItemStyle-CssClass="right" HeaderStyle-CssClass="right">
                <HeaderTemplate> Action </HeaderTemplate>
                <ItemTemplate>
                    <asp:HyperLink ID="hlkView" runat="server" Text="[View]" NavigateUrl='<%#Eval("TicketID","TicketViewPrint.aspx?TicketID={0}") %>'></asp:HyperLink>
                    <asp:HyperLink ID="HyperLink1" runat="server" Text="[Edit]" NavigateUrl='<%#Eval("TicketID","TicketEdit.aspx?TicketID={0}") %>'></asp:HyperLink>
                </ItemTemplate>
                <HeaderStyle CssClass="right"></HeaderStyle>
                <ItemStyle CssClass="right"></ItemStyle>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    
    </asp:Content>
